package com.edu.demo.entity.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author XYH
 * date 2024-03-08
 * 用户通过用户名和密码登录
 * lombok插件
 */

@AllArgsConstructor
@NoArgsConstructor
@Data
public class UserLoginByPassVO {

    @NotBlank(message = "参数不能留白、不能只由空格、Tab、换行符组成")
    @NotNull(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;


    @NotNull(message = "密码不能为空")
    @Length(min = 6, max = 11, message = "密码必须在6-11位")
    @Pattern(regexp = "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$", message = "密码必须包含大小写字母和数字")
    @ApiModelProperty(value = "密码", required = true)
    private String password;

}
